package co.edu.usbcali.raju.games.chess.engine;

import jpl.Query;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;

import co.edu.usbcali.raju.games.chess.client.InputXBoardAdapter;
import co.edu.usbcali.raju.games.chess.controller.ChessController;
import co.edu.usbcali.raju.games.chess.model.AlphaBetaSearch;
import co.edu.usbcali.raju.games.chess.model.EvaluateForce;
import co.edu.usbcali.raju.games.chess.model.EvaluateThreat;
import co.edu.usbcali.raju.games.chess.server.XBoardAdapter;
import co.edu.usbcali.raju.model.ComplexEvaluator;

public class TestText {

	static Logger logger;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		logger=Logger.getLogger(TestText.class.getName());
		logger.setLevel(Level.DEBUG);
		try{
		initProlog();
		ComplexEvaluator evaluator=new ComplexEvaluator();
		evaluator.put(EvaluateForce.getInstance(), 0.5d);
		evaluator.put(EvaluateThreat.getInstance(), 0.5d);
		ChessController controller=new ChessController(new AlphaBetaSearch(20),evaluator);
		XBoardAdapter engine=new XBoardAdapter(controller);
		InputXBoardAdapter listener=new InputXBoardAdapter(engine);
		listener.run();
		}catch (Exception e) {
			logger.error(e.getMessage());
		}
		// TODO Auto-generated method stub

	}
	
	public static void initProlog(){
		String t3 = "consult('chessEval3.pl')";
		Query q3 = new Query(t3);
		q3.hasSolution();
	//	System.out.println( t3 + " " + (q3.hasSolution() ? "succeeded" : "failed") );
	}


}

